/****************************************************************************/
/****************************************************************************/
/*                                                                          */
/* This file contains the interface functions                               */
/* you should use for the wet ex 2                                                                       */ 
/*                                                                          */ 
/****************************************************************************/
/****************************************************************************/

/****************************************************************************/
/*                                                                          */ 
/* File Name : library2.h                                                   */ 
/*                                                                          */ 
/****************************************************************************/

#ifndef _234218_WET2_01_07 
#define _234218_WET2_01_07

#ifdef __cplusplus
extern "C" {
#endif


// return values
const int SUCCESS = -1;
const int FAILURE  = -2;

const int TRUE = 1;
const int FALSE = 0;

// required interface to data structure
// ------------------------------------

// initialize data structure
// input: 
// return: void pointer to the data structure 
void*	init();

// release data structure memory
// input: DS - pointer to the data structure
// return: void
void 	quit(void* DS);

// add an interval to DS
// input: DS - pointer to the data structure
//        a,b - endpoints
// return: SUCCESS/FAILURE
int 	addInterval (void* DS, int a, int b);

// remove an interval from DS
// input: DS - pointer to the data structure
//        a,b - endpoints
// return: SUCCESS/FAILURE
int 	removeInterval (void* DS, int a, int b);

// count intervals in DS
// input: DS - pointer to the data structure
//        k - point
// return: number of lines (a,b) s.t a <k<b
//         FAILURE
int 	countIntervals (void* DS, int k);

// move left point in intervals of DS
// input: DS - pointer to the data structure
//        a - left endpoint
//        k - point
// return: SUCCESS/FAILURE
int 	shiftLeftInterval (void* DS, int a, int k);

// check whether an interval exists
// input: DS - pointer to the data structure
//        a,b - endpoints
// return: TRUE/FALSE
int 	doesIntervalExist (void* DS, int a, int b);

#ifdef __cplusplus
}
#endif

#endif    /* _234218_WET2_01_07 */  

